<template>
  <swmodal :isShow="isShow" :isShowBg="false" :bgColor="'transparent'" :modalClass="modalClass">
    <div class="sw-message" v-text="msg"></div>
  </swmodal>
</template>

<script type="text/javascript">
import swmodal from './index.vue'

export default {
  name: 'sw-message',
  data () {
    return {
      msg: '',
      time: 3000,
      isShow: true,
      modalClass: ''
    }
  },
  mounted () {
    this.close()
  },
  components: {
    swmodal
  },
  methods: {
    close () {
      window.setTimeout(() => {
        this.isShow = false

        this.cb && this.cb()
      }, this.time)
    }
  }
}
</script>

<style type="text/css">
  .sw-message {
    padding: 10px;
    line-height:20px;
    color: #fff;
/*    background: #80909C;*/
    font-size:14px;
    background: #5A9ADA;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.50);
    border-radius: 4px;
  }
</style>
